<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@page import="java.net.URLEncoder"%>
<%@page import="tw.com.bo.Report01BO"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 

<c:if test="${formData.excelURL != null }">
<div class="rpt01Container" >
	<div><a href="${formData.excelURL }"><spring:message code="report.download"/></a></div>
	<table width="100%"  class="rpt" >
		<thead >
			<tr >
				<th >
					<spring:message code="report01.reportName.${formData.reportType }"/>
				</th>
				<th colspan="8" class="header">
					
				</th>
			</tr>
		</thead>
		<tbody>
			<tr>
				<th rowspan="2"><spring:message code="report01.table.header01"/></th>
				<th rowspan="2"><spring:message code="report01.table.header02"/></th>				
				<th colspan="3"><spring:message code="report01.table.header03"/></th>
				<th colspan="3"><spring:message code="report01.table.header04"/></th>
				<th rowspan="2"><spring:message code="report.percentage"/></th>
			</tr>
			<tr>
				<th><spring:message code="report01.table.header05"/></th>
				<th><spring:message code="report01.table.header06"/></th>
				<th><spring:message code="report01.table.header07"/></th>
				<th><spring:message code="report01.table.header05"/></th>
				<th><spring:message code="report01.table.header06"/></th>
				<th><spring:message code="report01.table.header07"/></th>
				
			</tr>
			<c:forEach items="${reportDataList }" var="data" varStatus="status">
			<tr>
				<th width="16%">${data.itemName }</th>
				<td width="12%" class="bluesum">					
					<c:if test="${formData.reportType == 'PRO'}">
						<c:if test="${not status.last}">
							<a href="${pageContext.request.contextPath}/report02/doPreview.do?reportType=DD&timeType=Month&fromReport=${formData.reportType }&defStartYear=${formData.defStartYear }&startYear=${formData.startYear }&endYear=${formData.endYear }&searchKey=${status.index +1}">${data.tatolSum }</a>
						</c:if>
						<c:if test="${status.last}">
							<a href="${pageContext.request.contextPath}/report02/doPreview.do?reportType=DD&timeType=Month&fromReport=${formData.reportType }&defStartYear=${formData.defStartYear }&startYear=${formData.startYear }&endYear=${formData.endYear }&searchKey=showTotal">${data.tatolSum }</a>
						</c:if> 
					</c:if>
					<c:if test="${formData.reportType == 'DEP'}">
						<c:if test="${not status.last}">							
							<a href='${pageContext.request.contextPath}/report02/doPreview.do?reportType=DD&timeType=Month&fromReport=${formData.reportType }&defStartYear=${formData.defStartYear }&startYear=${formData.startYear }&endYear=${formData.endYear }&searchKey=${data.itemCode }'>${data.tatolSum }</a>
						</c:if>
						<c:if test="${status.last}">
							<a href="${pageContext.request.contextPath}/report02/doPreview.do?reportType=DD&timeType=Month&fromReport=${formData.reportType }&defStartYear=${formData.defStartYear }&startYear=${formData.startYear }&endYear=${formData.endYear }&searchKey=showTotal">${data.tatolSum }</a>
						</c:if>
						
					</c:if>
				</td>				
				<td width="8%" class="sum">${data.finishCaseSum }</td>
				<td width="8%">${data.finishCaseOnTimeSum }</td>
				<td width="8%">${data.finishCaseBehindTimeSum }</td>
				<td width="8%" class="sum">${data.unfinishCaseSumSum }</td>
				<td width="8%">${data.unfinishCaseOnTimeSum }</td>
				<td width="8%">${data.unfinishCaseBehindTimeSum }</td>
				<td width="8%">${data.ratioOfAll}%</td>				
			</tr>
			</c:forEach>
			<tr><th width="16%"><spring:message code="report.note"/></th><td colspan="8"> </td></tr>
		</tbody>
	</table>
	<P class="chartContainer">
	<img src="${formData.imageURL }"  usemap="#map0">
	</P>
</div>
</c:if>
<c:if test="${formData.excelURL == null && doLoad == null }">
<div class="rpt01Container" >
	<h3>查無報表資料!</h3>
</div>
</c:if>